Copying index settings to replicas and other indices.
searchableAttributes
setting, you probably want it to apply to all indices.
The forwardToReplicas
parameter allows you to forward new settings to replicas. From there, you can change only the settings that need to be different and keep all others synchronized.
products
and a products_price_desc
replica. Both indices have the same data and settings, apart from the ranking
setting.
If you want to change the searchableAttributes
setting to include a new description
attribute for all indices, primary and replicas, use the forwardToReplicas
parameter.
setSettings
method, along with all synonyms and Rules methods, have a forwardToReplicas
parameter. By default, forwardToReplicas
is false
, so any setting, synonym, or Rule change only applies to the target index. By setting it to true
, you can forward these changes to all the replicas belonging to the index you target.
inventory
attribute, and then choose to copy the updated ranking
setting to all replicas, you overwrite any previously set sorts on other attributes on the replicas.
When altering the ranking formula on indices with replicas, you are recommended to do it on a per index basis.
While customRanking
is part of the ranking formula, it’s a setting as well. You can alter the custom ranking and forward the change to your replicas without worrying about overwriting the entire ranking formula.
You usually don’t need to worry about overwriting settings, since you typically want most settings to be the same between replicas. Notable exceptions include ranking
and typoTolerance
.